<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <style>
    /* html,body{
      width: 100%;
      padding: 100%;
      background-color: cyan;
    } */
    .box{
      width: 100%;
      border: 1px solid black;
      /* clear: both; */
      overflow: hidden;
    }

    .item1 {
      width: 100px;
      height: 100px;
      float: left;
      border: 1px solid black;
    }
    .item2{
      width: 100px;
      height: 100px;
      float: right;
      border:1px solid black;
    }
  </style>
  <div class="box">
    <div class="item1"></div>
    <div class="item2"></div>
  </div>
</body>
</html>